package com.huqing.icu.rentuser.service.impl;

import com.huqing.icu.constants.KafkaTopicConstants;
import com.huqing.icu.rentuser.model.User;
import com.huqing.icu.rentuser.service.IUserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

/**
 * @Description 用户登录实现类
 * @Author huqing
 * @Date 2025/9/6 13:52
 **/
@Service
public class UserLoginServiceImpl implements IUserLoginService {

    @Autowired
    private KafkaTemplate<String, Object> kafkaTemplate;


    @Override
    public String login(String mobile) {
        return null;
    }

    @Override
    public String loginOut(String mobile) {
        return null;
    }

    /**
     * 注册
     *
     * @return
     */
    @Override
    public Integer register() {


        //先保存用户信息
        

        User user = new User();
        //向kafka发送消息，更新新增人数、总人数等数据
        kafkaTemplate.send(KafkaTopicConstants.UserPrefix.UPDATE_USER_NUM, user);
        return 1;
    }
}
